package com.jinwei.qunguanjia.web.user.vo;

import lombok.Data;

@Data
public class UserIntegralVO {
    /** 积分id */
    private String userIntegralId;
    /** 积分类型: 0赚取 1消耗 */
    private String integralType;
    /** 积分来源: 1上传群 2完善信息 3看广告 4在线 5解锁群 */
    private String integralSource;
    /** 积分数量 */
    private String integralNumber;
    /** 用户id */
    private String userId;
    /** 创建时间 */
    private String createTime;
    /** 更新时间 */
    private String updateTime;

    public void setIntegralSource(String integralSource) {
        switch (integralSource) {
            case "1" : integralSource= "上传群"; break;
            case "2" : integralSource = "完善信息"; break;
            case "3" : integralSource = "看广告"; break;
            case "4" : integralSource = "在线"; break;
            case "5" : integralSource = "解锁群"; break;
        }
        this.integralSource = integralSource;
    }

    public String getIntegralNumber() {
        if (this.integralType.equals("0")) {
            return "+" + this.integralNumber;
        } else {
            return "-" + this.integralNumber;
        }
    }

}
